<?php
$T->loadTpl("./html/".$template."/".$qname.".html");
$T->SetTpl('cssjs','html/cssjs.inc'); 
$T->SetTpl('jsmodel','html/jsmodel.inc');     
  
$p = isset($_GET["p"]) ? $_GET["p"] : "1";
        if ($p < 1)
            $p = 1;
       
        $rc = $T->db->query("select count(*) from file_upload where (not locate('".$_SESSION['username']."',recvdele) or ISNULL(recvdele)) and (to_id = 'ALL_DEPT' or locate('".$_SESSION['department']."',to_id) or locate('".$_SESSION['role']."',priv_id) or locate('".$_SESSION['username']."',copy_to_id))")->fetchColumn(0);
        $page = getPageHtml_bt($rc, 15, $p, "");
        $page = mb_convert_encoding($page, 'utf-8', 'utf-8');
        $T->Set("page", $page);
        $T->SetBlock("list", "select id,title,description,from_id,uploadtime,readers from file_upload where (not locate('".$_SESSION['username']."',recvdele) or ISNULL(recvdele)) and (to_id = 'ALL_DEPT' or locate('".$_SESSION['department']."',to_id) or locate('".$_SESSION['role']."',priv_id) or locate('".$_SESSION['username']."',copy_to_id)) order by uploadtime desc limit " . (($p - 1) * 15) . ",15",NULL,NULL,"fileReceiveList");

$T->Set("template",$template);         
$T->clearNaN();       
$T->clearNoN();
$T->display(); 